package com.justcs.config;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import javax.servlet.MultipartConfigElement;

/**
 * SpringMVC配置
 */
@Configuration
public class SpringMVCConfig extends WebMvcConfigurerAdapter {


    /**
     * springmvc关于multipart的配置
     *
     * @return
     */
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setMaxFileSize("5MB");
        factory.setMaxRequestSize("50M");
        return factory.createMultipartConfig();
    }


}
